/**   
* @Project：zz-core  
* @Title：PropertiesUtils.java   
* @Description：   
* @Package com.zt.ws.core.util
* @author：yangyucheng
* @date：2018年3月21日
* @Copyright: 上海顺益信息科技有限公司 All rights reserved.
* @version V1.0
*/ 
package com.echo.model.utils;

import org.springframework.context.EmbeddedValueResolverAware;
import org.springframework.stereotype.Component;
import org.springframework.util.StringValueResolver;

@Component
public class PropertiesUtils implements EmbeddedValueResolverAware {
	
	private static StringValueResolver stringValueResolver;
	
	@Override
	public void setEmbeddedValueResolver(StringValueResolver resolver) {
		stringValueResolver = resolver;
	}
	
	public static String getPropertiesValue(String key){
		key = "${"+key+"}";
		return stringValueResolver.resolveStringValue(key);
	}
	
}
